package com.mnsq.book.bean.entity;


import com.mnsq.book.bean.base.BaseEntity;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.*;

/**
 * @author Administrator
 * @date 2019/1/20 0020
 */
@Data
@Accessors(chain = true)
@Entity
@Table(name = "x_book", indexes = {@Index(name = "author_idx", columnList = "author")})
public class Book extends BaseEntity {

    /**
     * 作者
     */
    private String author;
    /**
     * 年份，可选精确度
     */
    private String year;
    /**
     * 评分分值
     */
    private String score;
    /**
     * 书籍名称
     */
    private String name;
    /**
     * 书籍主图地址
     */
    @Column(name = "main_img",columnDefinition = "varchar(300) comment '书籍主图地址'")
    private String mainImg;
    /**
     * 主图ID
     */
    @Column(name = "main_img_id",columnDefinition = "bigint(12) comment '书籍主图id'")
    private Long mainImgId;
    /**
     * 书籍查看url
     */
    @Column(name = "book_url",columnDefinition = "varchar(300) comment '书籍地址'")
    private String bookUrl;
    /**
     * 原始tag
     */
    private String tag;

    @OneToOne
    @JoinColumn(name = "book_info_id")
    private BookInfo bookInfo;
}
